
package com.example.function.project.model.pojo;


import com.example.common.support.ApplicationContextProvider;
import com.example.function.project.model.one.ProspectusTemplate;
import com.example.function.project.service.IProspectusTemplateService;
import lombok.Data;
import org.springframework.beans.BeanUtils;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
/**
 * Description: <ProspectusTemplatePojo vo>. <br>
 *
 * generate time:2021-7-30 16:24:12
 *
 * @author hanqf
 * @version V1.0
 */
@Data
public class ProspectusTemplatePojo implements Serializable{
	private static final long serialVersionUID = 1L;

	/*
	 * 计划书模板id
	 */
		private java.lang.Long id;




	/*
	 * 计划书模板名称
	 */
	private java.lang.String templateName;


	/*
	 * 计划书模板实际存储名称
	 */
	private java.lang.String templateSaveName;

	/*
	 * 计划书大小（KB）
	 */
	private java.lang.Integer templateSize;




	/*
	 * 路径
	 */
	private java.lang.String templatePath;




	/**
	 * 实体对象复制到数据对象
	 */
	public static ProspectusTemplatePojo wrapper(ProspectusTemplate prospectusTemplate){
		ProspectusTemplatePojo prospectusTemplatePojo = new ProspectusTemplatePojo();
		BeanUtils.copyProperties(prospectusTemplate, prospectusTemplatePojo);
		final IProspectusTemplateService prospectusTemplateService = (IProspectusTemplateService)ApplicationContextProvider.getBean("prospectusTemplateService");

		return prospectusTemplatePojo;
	}


	/**
	 * 实体对象复制到数据对象List
	 */
	public static List<ProspectusTemplatePojo> wrapper(List<ProspectusTemplate> prospectusTemplateList) {
			List<ProspectusTemplatePojo> ProspectusTemplatePojoList = new ArrayList<>();
			for (ProspectusTemplate prospectusTemplate : prospectusTemplateList){
				ProspectusTemplatePojoList.add(ProspectusTemplatePojo.wrapper(prospectusTemplate));
			}
			return ProspectusTemplatePojoList;
		}

}



